﻿{include file="public/header"}
<title>订单录入</title>
</head>
<body>

<article class="page-container">
    <form>
        <div class="ch-row ch-info-form">
            <div class="flex1">级别：</div>
            <div class="flex2">
                <select name="title" class="form-control">
                    <option  value="0" <?php if($data['title']==0){?>selected <?php } ?>>普通合伙人</option>
                    <option value="1" <?php if($data['title']==1){?>selected <?php } ?>> 高级合伙人</option>
                    <option value="2" <?php if($data['title']==2){?>selected <?php } ?>>钻石合伙人</option>
                </select>
            </div>
        </div>
        <input  name="ti" type="hidden" value="{$data.ti}">
        <div class="ch-row ch-info-form">
            <div class="flex1">佣金：</div>
            <div class="flex2">
                <input  name="yong" class="form-control" value="{$data.yong}" placeholder="提成比例">
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <div class="flex1">比例：</div>
            <div class="flex2">
                <input  name="bi" class="form-control" value="{$data.bi}" placeholder="提成比例">
            </div>
        </div>
        <div class="ch-row">
            <div class="flex1">
                <button class="btn btn-primary radius" style="width: 100%" type="button"><i class="Hui-iconfont">&#xe632;</i> 提交</button>
            </div>
        </div>
    </form>

</article>
{include file="public/footer"}
<script>
    $('.radius').click(function () {

            var src="{:Url('index/Income/edit')}";
            $.ajax({
                type: 'POST',
                url: src,
                dataType: 'json',
                data:$('form').serializeArray(),
                success: function (data) {
                    var res=JSON.parse(data);
                    if(res.code==200){
                        layer.msg(res.msg, {icon: 1, time: 2000}, function (index,layero) {
                            parent.location.reload()
                        });
                    }else{
                        layer.msg(res.msg,{icon: 5,time:1000});
                    }

                },
                error: function (data) {
                    console.log(data.msg);
                },
            });



    });
</script>
</body>
</html>